let prop = "name";
const obj1 = {
    // 使用表达式作为属性名,需要加方括号
    [prop]: "liao"
};
console.log(obj1.name); // 'liao'


let name = Symbol();
let obj2 = {
    [name]: "liao"
};
console.log(obj2); // { Symbol(): 'liao' }

console.log(obj2[name]); // 'liao'
console.log(obj2.name); // undefined